package com.app.repository.impl;

import com.app.model.main.Version;
import com.app.repository.interfaces.VersionMapper;
import com.app.support.dao.MybatisDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by Lichaojie on 2017/3/12. It's a beautiful day.
 */
@Repository
public class VersionMapperImpl implements VersionMapper {

    @Autowired
    private MybatisDao mybatisDao;

    @Override
    public int deleteByPrimaryKey(Long id){
        return mybatisDao.delete("com.app.dao.main.VersionMapper",".deleteByPrimaryKey",id);
    }

    @Override
    public int insert(Version record){
        return mybatisDao.insert("com.app.dao.main.VersionMapper",".insert",record);
    }

    @Override
    public int insertSelective(Version record){
        return mybatisDao.insert("com.app.dao.main.VersionMapper",".insertSelective",record);
    }

    @Override
    public Version selectByPrimaryKey(Long id){
        return mybatisDao.get("com.app.dao.main.VersionMapper",".selectByPrimaryKey",id);
    }

    @Override
    public int updateByPrimaryKeySelective(Version record){
        return mybatisDao.update("com.app.dao.main.VersionMapper",".updateByPrimaryKeySelective",record);
    }

    @Override
    public int updateByPrimaryKeyWithBLOBs(Version record){
        return mybatisDao.update("com.app.dao.main.VersionMapper",".updateByPrimaryKeyWithBLOBs",record);
    }

    @Override
    public int updateByPrimaryKey(Version record){
        return mybatisDao.update("com.app.dao.main.VersionMapper",".updateByPrimaryKey",record);
    }

    @Override
    public long getMaxId(){
        return mybatisDao.count("com.app.dao.main.VersionMapper",".getMaxId",null);
    }
}
